package com.guli.order.config;
/*
 * @Author 罗俊
 * @date 2020/11/18 - 2:06 下午
 *
 */

import com.guli.order.interceptor.LoginUserInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@Slf4j
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        LoginUserInterceptor loginUserInterceptor = new LoginUserInterceptor();

        registry.addInterceptor(loginUserInterceptor).addPathPatterns("/**");

        log.info("用户登陆拦截器配置完成..");
    }
}
